<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            background-size: cover;
            background-size:contain;
        }
        /* 小于等于768、769~992、993~1199、大于等于1200 */
      @media screen and (max-width: 768px) {
          body {
              background-color: green;
          }
      }
      @media screen and (min-width: 769px) {
          body {
              background-color: pink;
          }
      }
      @media screen and (min-width: 993px) {
          body {
              background-color: red;
          }
      }
      @media screen and (min-width: 1200px) {
          body {
              background-color: yellow;
          }
      }

    </style>
</head>
<body>
    <div></div>
</body>
</html>